package com.yootk.action.advice;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class ErrorAdvice {
    @ExceptionHandler(Exception.class)
    public ModelAndView handle(Exception e){
        ModelAndView mav = new ModelAndView("/error");
        mav.addObject("message",e.getMessage()) ;
        return mav ;
    }
}
